import { createRouter, createWebHistory } from 'vue-router'
import { loginRoute } from './login'
import { homeRoute } from './home'
import { functionRoute } from './function'
import { useLoginStore } from '@/stores/login'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue'),
      children: [...loginRoute]
    },
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/LoginDefault.vue'),
      children: [...homeRoute,...functionRoute]
    },
    {
      path: '/chat',
      name: 'chat',
      component: () => import('@/views/ai-chat/index.vue')
    },
    {
      path: '/test',
      name:'test',
      component: () => import('@/views/test1/test.vue')
    }
  ],
})

export default router
